package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
	"ocane/models"
	"ocane/utils"
)

type CompanyListController struct {
	beego.Controller
}

type CompanyHotListController struct {
	beego.Controller
}




func (this *CompanyListController) Get(){
	companyName := this.GetString("companyName")
	companyList := models.QueryCompanyListByLikeCompanyName(companyName)
	this.Data["json"] = models.Result{Data: companyList,Code: 200}
	this.ServeJSON()
}

func (this *CompanyHotListController) Get()  {
	list := utils.GetScoreList(redis_key, 0, 10)
	for i := 0; i <len(list)/2 ; i++ {
		template := list[len(list)-i-1]
		list[len(list)-i-1] = list[i]
		list[i] = template
	}
	this.Data["json"] = models.Result{Data: list,Code: 200}
	this.ServeJSON()
}
